package Spring.cn.edu.scau.cmi.lishuoxin.util;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/*
 * Spring工具类：用来获取applicationContext对象。
 */
public class SpringUtil {

	private static ApplicationContext applicationContext=null;
	
	public static ApplicationContext getContext() {
		if(applicationContext == null) {
			applicationContext = new ClassPathXmlApplicationContext("Spring/cn/edu/scau/cmi/lishuoxin/applicationContext.xml");
		}
		return applicationContext;
	}
}
